﻿using System;
using System.Globalization;
using System.Windows.Data;
using StudentInfoSystem.Core.Models.Enums;

namespace StudentInfoSystem.UI.Converters
{
    public class GenderToChineseConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is Gender gender)
            {
                return gender switch
                {
                    Gender.Male => "男",
                    Gender.Female => "女",
                    _ => "未知"
                };
            }
            return "未知";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}